# 导包
import redis

# IP和端口
host = 'localhost'
port = 6379

# 连接对象
r = redis.Redis(host=host, port=port)

r.set('test', 'test')

# 获取
mytest = r.get('test')

# 转码
mytest = mytest.decode('utf-8')

print(mytest)
